<template>
	<view>
		<view class="page">
			<comp-common v-bind="{data:data}"></comp-common>
			<comp-header v-bind="{data:data}"></comp-header>
			<view class="body after-navber">
				<view class="list">
					<view class="item flex flex-row" v-for="(item,index) in data.list" :key="index">
						<view class="flex-grow-1">
							<view>{{item.desc}}</view>
							<view style="font-size: 9pt;color: #888;margin-top: 12upx">{{item.addtime}}</view>
						</view>
						<view class="flex-grow-0 flex-y-center" style="color: #3fc24c;" v-if="item.type==1">+{{item.price}}
						</view>
						<view class="flex-grow-0 flex-y-center" style="color: #ff4544;" v-else>-{{item.price}}</view>
					</view>
				</view>
				<list-loading v-bind="{data:data}"></list-loading>
			</view>
			<comp-footer v-bind="{data:data}"></comp-footer>
		</view>
	</view>
</template>

<script>var myVue = {};
	export default {
		data() {
			return {
				data: {
					list: [],
					current_page: 0,
					loading: !1,
					no_more: !1
				},
			};
		},
		onLoad: function (t) {myVue = this;
			myVue.getApp.page.onLoad(this, t);
			this.getList();
		},
		onReady: function () {
			myVue.getApp.page.onReady(this);
		},
		onShow: function () {
			myVue.getApp.page.onShow(this);
		},
		onHide: function () {
			myVue.getApp.page.onHide(this);
		},
		onUnload: function () {
			myVue.getApp.page.onUnload(this);
		},
		onPullDownRefresh: function () {},
		onReachBottom: function () {
			this.getList();
		},


		methods: {
			getList: function () {
				var a = this;
				if (!a.data.loading && !a.data.no_more) {
					a.setData({
						loading: !0
					});
					var e = a.data.current_page + 1;
					a.getApp.request({
						url: a.getApp.api.store.user.account_log,
						data: {
							page: e,
							year: "",
							month: ""
						},
						success: function (t) {
							0 == t.code && (t.data.list && t.data.list.length ? (a.data.list = a.data.list.concat(t.data.list),
								a.setData({
									list: a.data.list,
									current_page: e
								})) : a.setData({
								no_more: !0
							})), 1 == t.code && a.getApp.core.showModal({
								title: "提示",
								content: t.msg,
								showCancel: !1
							});
						},
						complete: function (t) {
							a.setData({
								loading: !1
							});
						}
					});
				}
			},
		}

	}
</script>

<style scoped>
	.list {
		border-top: 1upx solid #e3e3e3;
		border-bottom: 1upx solid #e3e3e3;
	}

	.item {
		background: #fff;
		padding: 24upx;
		border-bottom: 1upx solid #eee;
	}

	.item:last-child {
		border-bottom: none;
	}

	.item>.flex-grow-0 {
		padding-left: 24upx;
		font-weight: bold;
		font-size: 15pt;
	}
</style>